package com.mowh.gof23.creational.patterns.prototype;

import com.mowh.gof23.creational.patterns.prototype.framework.Manager;
import com.mowh.gof23.creational.patterns.prototype.framework.Product;

/**
 * @author mowh1gd
 * @create 2023/10/20 15:37
 */
public class Main {
    public static void main(String[] args) throws CloneNotSupportedException {
        Manager manager = new Manager();
        UnderlinePen uPen = new UnderlinePen('~');
        MessageBox mBox = new MessageBox('*');
        MessageBox sBox = new MessageBox('/');
        manager.register("strong message", uPen);
        manager.register("warning box", mBox);
        manager.register("slash box", sBox);

        Product p1 = manager.create("strong message");
        p1.use("Hello, world.");
        Product p2 = manager.create("warning box");
        p2.use("Hello, world.");
        Product p3 = manager.create("slash box");
        p3.use("Hello, world.");

    }
}
